var App = require("../../base/app");
var utils = require("../../utils/utils");
var common = require("./common");
var inTask = require("./inTask");
var baiDuChangTing = new App("百度畅听版", {
  interval: 10,
  testOpenCount: 3,
  storage: common.storage,
});
var aOneAcc = require("./aOneAcc");
var aOneAdd1 = require("./aOneAdd1");
var aOneAdd2 = require("./aOneAdd2");
var aOpen1 = require("./aOpen1");
var aOpen2 = require("./aOpen2");
var aRead = require("./aRead");
var aSearch5 = require("./aSearch5");
var aTreasure = require("./aTreasure");
baiDuChangTing.runTest = function () {
  common.toTask();
  sleep(utils.getRandom(3, 7, 1000));
};
baiDuChangTing.as = [
  aSearch5,
  aOneAcc,
  aOneAdd1,
  aOneAdd2,
  aOpen1,
  aOpen2,
];
baiDuChangTing.run = function () {
  aRead.flow();
  if (common.inHome()) {
    sleep(utils.getRandom(1.5, 2, 1000));
    common.toTask();
    sleep(utils.getRandom(5, 8, 1000));
    inTask.run();
    var nextAction = this.getNextAction();
    if (nextAction) {
      nextAction.flow();
    }
    aTreasure.flow();
  }
};

module.exports = baiDuChangTing;
